<template>
  <div>
    <div class="banner_wrap">
      <div class="banner_bg"></div>
      <van-swipe class="my-swipe"
                 :autoplay="3000"
                 indicator-color="white"
                 ref="myswipe">
        <van-swipe-item v-for="(item,index) in bannerlist"
                        :key="index">
          <a :href="item.url">
            <img :src="item.image">
          </a>
        </van-swipe-item>

      </van-swipe>

    </div>
    <!-- <van-button type="primary"
                @click="next">下一页</van-button> -->
  </div>
</template>
<script>
export default {
  data () {
    return {}
  },
  computed: {},
  methods: {
    next () {
      var myswipe = this.$refs.myswipe;
      myswipe.next()
    }
  },
  props: ["bannerlist"]
}
</script>
<style lang="less">
.banner_wrap {
  width: 100%;
  height: 300px;
  position: relative;
  .banner_bg {
    width: 100%;
    height: 200px;
    border-radius: 0 0 50px 50px;
    background: red;
    position: absolute;
    top: 0;
    left: 0;
  }
  .my-swipe {
    width: 80%;
    height: 270px;
    position: absolute;
    margin: auto;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    img {
      width: 100%;
      height: 270px;
    }
  }
}
</style>